package cn.kgc.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author 课工场
 * @date 2025/1/9
 * @description
 */
@Configuration
public class BeansConfig {

    @Bean
    @LoadBalanced   //  赋予RestTemplate 通过服务名实现http通信的能力
    public RestTemplate restTemplate(){
        RestTemplate restTemplate = new RestTemplate();
        return  restTemplate;
    }
}
